/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.camachosanchez.bean;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ZULLY
 */
@Entity
@Table(name = "detalle_alineacion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleAlineacion.findAll", query = "SELECT d FROM DetalleAlineacion d"),
    @NamedQuery(name = "DetalleAlineacion.findById", query = "SELECT d FROM DetalleAlineacion d WHERE d.id = :id"),
    @NamedQuery(name = "DetalleAlineacion.findByAngulo", query = "SELECT d FROM DetalleAlineacion d WHERE d.angulo = :angulo"),
    @NamedQuery(name = "DetalleAlineacion.findByPosicion", query = "SELECT d FROM DetalleAlineacion d WHERE d.posicion = :posicion")})
public class DetalleAlineacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "angulo")
    private BigDecimal angulo;
    @Column(name = "posicion")
    private Short posicion;
    @JoinColumn(name = "id_tipo_angulo", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private TipoAngulo idTipoAngulo;
    @JoinColumn(name = "id_funcion_eje", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private FuncionEje idFuncionEje;
    @JoinColumn(name = "id_alineacion", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Alineaciones idAlineacion;
    @JoinColumn(name = "id_neumatico", referencedColumnName = "id")
    @ManyToOne(fetch = FetchType.LAZY)
    private Neumaticos idNeumatico;

    public DetalleAlineacion() {
    }

    public DetalleAlineacion(Integer id) {
        this.id = id;
    }

    public DetalleAlineacion(Integer id, BigDecimal angulo) {
        this.id = id;
        this.angulo = angulo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigDecimal getAngulo() {
        return angulo;
    }

    public void setAngulo(BigDecimal angulo) {
        this.angulo = angulo;
    }

    public Short getPosicion() {
        return posicion;
    }

    public void setPosicion(Short posicion) {
        this.posicion = posicion;
    }

    public TipoAngulo getIdTipoAngulo() {
        return idTipoAngulo;
    }

    public void setIdTipoAngulo(TipoAngulo idTipoAngulo) {
        this.idTipoAngulo = idTipoAngulo;
    }

    public FuncionEje getIdFuncionEje() {
        return idFuncionEje;
    }

    public void setIdFuncionEje(FuncionEje idFuncionEje) {
        this.idFuncionEje = idFuncionEje;
    }

    public Alineaciones getIdAlineacion() {
        return idAlineacion;
    }

    public void setIdAlineacion(Alineaciones idAlineacion) {
        this.idAlineacion = idAlineacion;
    }

    public Neumaticos getIdNeumatico() {
        return idNeumatico;
    }

    public void setIdNeumatico(Neumaticos idNeumatico) {
        this.idNeumatico = idNeumatico;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleAlineacion)) {
            return false;
        }
        DetalleAlineacion other = (DetalleAlineacion) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.camachosanchez.bean.DetalleAlineacion[ id=" + id + " ]";
    }
    
}
